﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'operarioGet')
	BEGIN
		DROP  Procedure  operarioGet
	END
GO

CREATE PROCEDURE [dbo].[operarioGet] 	
	(	
		@empresa_id AS INT		
	)	
AS
BEGIN	
	SET NOCOUNT ON
	  
	SELECT	m.Id, 
			m.EmpresaId, 
			m.Nombre, 
			m.PuestoId, 
			p.Nombre As PuestoNombre, 
			m.CostoxHora
	FROM Lit_Operario m
	JOIN Lit_Puesto p ON m.PuestoId = p.Id
	WHERE m.EmpresaId = @empresa_id
	AND m.Activo = 1
	  
	SET NOCOUNT OFF
END
GO 